home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Presen…tion Library 2 (Reseller)
/
Apple R&P Lib Reseller v2.0.iso
/
3-Demos
/
HyperCard Demos
/
HyperMovies
/
CL⁄1
/
CL_1
/
card_25773.txt
< prev
next >
Wrap
Text File
|
1989-10-27
|
5KB
|
214 lines
-- card: 25773 from stack: in
-- bmap block id: 25885
-- flags: 4000
-- background id: 3493
-- name: Region 220
----- HyperTalk script -----
-- Script of card "Region 105"
on GetDataForCard cardName
--{ Hide the following for display:
global connectMode
if connectMode = "Simulation" then
S_GetDataForCard cardName
exit GetDataForCard
end if
--}
put the short name of me into cardName
put word 2 of cardName into regionNum
--put "select rep_nr,quota,sales,last_name from staff where rep_office = " & regionNum & " order by rep_nr descending; " into query
put "select rep_nr,quota,sales,last_name from staff" && "where rep_office = " & regionNum & " order by rep_nr; " into query
put "2,3,4,17" into fieldsToFill
PutDataInFields query, fieldsToFill, cardName
end GetDataForCard
--{ Hide the following for display:
on S_GetDataForCard cardName
--for the simulation mode:
put "staff" into tableName
put "rep_nr,quota,sales,last_name" into fmFields
put "2,3,4,17" into toFields
if cardName is empty
then put the short name of this card into cardName
put word 2 of cardName into regionNum
put "select" && fmFields && "from" && tableName && "where rep_office = " & regionNum && "order by rep_nr descending; " into s_query
S_PutDataInFields s_query,tableName, selectedRecords(tableName,"rep_office",regionNum), fmFields,toFields,cardName
end S_GetDataForCard
function selectedRecords tableName,keyFieldName,keyValue
set lockScreen to true
set lockMessages to true
push card card
go card tableName
get number of lines of card field keyFieldName
repeat with i = 1 to it
--select all records whose office number is in this region
if line i of card field keyFieldName = keyValue then
put i & "," after recordList
end if
end repeat
put empty into last char of recordList
pop card
set lockScreen to false
set lockMessages to false
return recordList
end selectedRecords
--}
-- part 18 (field)
-- low flags: 80
-- high flags: 2004
-- rect: left=16 top=62 right=260 bottom=493
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Card Script
----- HyperTalk script -----
on doSelect
put the mouseV into theClick
put textHeight of me into lineHeight
put rect of me into window
put item 1 of window into left
set the lockText of me to false
click at left, theClick
click at left, theClick + lineHeight with shiftKey
if the selection is not empty then
repeat until return is in the selection
add lineHeight to theClick
click at left, theClick + lineHeight with shiftKey
end repeat
end if
end doSelect
-- part 22 (field)
-- low flags: 81
-- high flags: 2000
-- rect: left=19 top=62 right=257 bottom=489
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Card Script Mask
----- HyperTalk script -----
on mouseUp
send doSelect to card field "Card Script"
end mouseUp
-- part 24 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=8 top=7 right=31 bottom=31
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
visual wipe right
go prev
end mouseUp
-- part 25 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=34 top=7 right=31 bottom=57
-- title width / last selected line: 0
-- icon id / first selected line: 1013 / 1013
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
visual wipe left
go Next
end mouseUp
-- part contents for background part 1
----- text -----
Sales Representative Data for Region 220
-- part contents for background part 6
----- text -----
rep_nr
-- part contents for background part 7
----- text -----
quota
-- part contents for background part 8
----- text -----
sales
-- part contents for background part 9
----- text -----
percent
-- part contents for background part 16
----- text -----
last_name
-- part contents for background part 26
----- text -----
status
-- part contents for card part 18
----- text -----
-- Script of card "Region 105"
on GetDataForCard
put the short name of me into cardName
put word 2 of cardName into regionNum
put "select rep_nr, quota, sales, last_name from staff where rep_office = " & regionNum & " order by rep_nr descending; " into query
put "2,3,4,17" into fieldsToFill
PutDataInFields query, fieldsToFill, cardName
end GetDataForCard
-- part contents for background part 2
----- text -----
700,1200,1700,1800
-- part contents for background part 3
----- text -----
129000.00,185000.00,69000.00,95000.00
-- part contents for background part 4
----- text -----
135652.20,165234.24,37502.21,56214.22
-- part contents for background part 31
----- text -----
Finkel,Crawford,Mathis,Harrison
-- part contents for background part 5
----- text -----
105.1,89.3,54.3,59.1